home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
1035
/
1035.xpi
/
chrome
/
1clickweather.jar
/
content
/
1clickweather
/
js
/
utils
/
configupdateobserver.js
< prev
next >
Wrap
Text File
|
2008-10-05
|
1KB
|
41 lines
// ⌐ 2005 The Weather Channel Interactive, Inc. All Rights Reserved.
function ConfigUpdateObserver(a) {
this.observerName = a;
}
ConfigUpdateObserver.prototype = {
funcObj : null,
setFunction : function(f){
this.funcObj = f;
},
observe : function(subject, topic, data) {
// ADD CODE THAT DOES STUFF....
//alert("NOTIFIED: " + subject + " " + topic + " " + data);
if(typeof(this.funcObj) != "undefined"){
this.funcObj(subject, topic, data);
}
},
register : function() {
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
if(this.observerName){
observerService.addObserver(this, this.observerName, false);
}else{
observerService.addObserver(this, "configupdate", false);
}
},
unregister: function() {
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
if(this.observerName){
observerService.removeObserver(this, this.observerName);
}else{
observerService.removeObserver(this, "configupdate");
}
}
}